<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
 <%@ include file="/common/query.jsp"%>
<%@ include file="/common/det.jsp"%>
<script>
        $(function(){
            init();
        });
        function init(){
            var setting = {};
            var url ="";
            var p_insert = false;
            var p_del = false;

            var add = true;
            var edit = true;
            var del = true;

            var productCategoryAttrgroupId = getQueryStringByDecode("productCategoryAttrgroupId");


            //crudDefaultInputWidth = "250px";
            crudDialogWidth = 300;
            var columns = [
                {field:'id',title:'id',hidden:true},
                {field:'productAttrName',title:'属性名',
                    dialog:{
                        mapper:{name:"属性名"},
                        url:"${base}/product/attr?search=false&singleSelect=true&productCategoryAttrgroupId="+productCategoryAttrgroupId,
                        width:300,
                        height:300,
                        select:function(iframe){
                            var row = iframe.getGridChecked()[0];
                            $('#crud-productAttrId').val(row.id);
                            $('#crud-productAttrName').val(row.name);
                        }
                    }
				},
                {field:'inputType',title:'输入类型',hidden:!search,insert:false,
                    input:{type:'radio',value : [{text:'文本输入',value:0,isDefault:true},{text:'单选',value : 10},{text:'多选',value : 20}]}
                },
                {
                    field:"isSale",title:"属性",insert:false,
                    input:{type:'radio',value : [{text:'',value:0,isDefault:true},{text:'销售属性',value : 1}]}
                },
                {field:'productCategoryAttrgroupId',title:'分组ID',hidden:true,defaultValue:productCategoryAttrgroupId},
                {field:'productAttrId',title:'属性ID',hidden:true}
            ];
            url='/product/category/attrgroup/attr/manager?search_EQ_productCategoryAttrgroupId='+productCategoryAttrgroupId;
            //setting.singleSelec	t = true;
            createQuery('body',columns,
				{
				    pager:false,edit:edit,editBtn:false,add:add,searchBar:{hidden:true},del:del,heji:false,xuhao:false,singleSelect:true,
					onClickRow:function () {
                        seeProductCategoryAttrgroupAttrValue();
                    }
				},
				url);
        };
        function seeProductCategoryAttrgroupAttrValue() {
			window.parent.seeProductCategoryAttrgroupAttrValue(getGridSelected());
        }
        

</script>
</head>
<body>
	  <div id="body"></div>
</body>
</html>